@model IList<HomeAutio.Mqtt.GoogleHome.Models.State.Device>

<div class="devices-page">
    <div class="page-header">
        <h1>Devices</h1>
    </div>

    <partial name="_ValidationSummary" />

    <div class="row">
        @if (Model.Any())
        {
            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Edit Devices</h3>
                    </div>
                    <div class="panel-body">
                        <div class="list-group">
                            <a asp-controller="GoogleDevice" asp-action="Create" class="list-group-item list-group-item-action active">Add Device</a>
                            @foreach (var device in Model)
                            {
                                <a asp-controller="GoogleDevice" asp-action="Edit" asp-route-deviceId="@device.Id" class="list-group-item list-group-item-action">
                                    @if (device.Disabled)
                                    {
                                        <span class="badge">disabled</span>
                                    }
                                    @device.Id
                                </a>
                            }
                        </div>
                    </div>
                </div>
            </div>
        }
        else
        {
            <div class="alert alert-warning">
                <strong>No Devices</strong>
                There are no devices configured.
            </div>
        }
    </div>
</div>